import axios from "../utils/axiosUtils"

/**
 * 获取所有的分类,传递父分类
 * {params:{parentId:0}}}  /categroy/findCategroy?parentId=0
 * @param {*} data = {parentId:0} 
 */
export const findAllCategoryApi = (data)=>{
    return axios.get("/categroy/findCategroy",{
        params:data
    })
}

/**
 * 添加分类
 * @param {*} data 
 * @returns 
 */
export const addCategoryApi = (data)=>{
    return axios.post("/categroy/addCategroy",data)
}

/**
 * 添加商品需要用到级联分类
 * @returns 
 */
export const getCascadeCategoryApi = ()=>{
    return axios.get("/categroy/findAllCategroy")
}

